#ifndef	_RTC_API_H_
#define _RTC_API_H_

#include "typedef.h"
#include "rtc_operation.h"

#ifdef __C51__

#define IRTC_CSEN IRTCON|=BIT(0)
#define IRTC_CSDIS IRTCON&=~BIT(0)

#define MAX_ALARM 1

void write_rtc(RTC_TIME *curr_time_rtc);
void read_rtc(RTC_TIME *curr_time_rtc);

void write_alm(RTC_TIME *curr_time_alm);
void read_alm(RTC_TIME *curr_time_alm);
void reset_rtc_ram(void);

#endif


//enum
//{
//    NO_DEVICE = 0,
//    DEVICE_SDMMC0 = 1,
//    //DEVICE_SDMMC1,
//    DEVICE_UDISK = 2,
//    DEVICE_AUTO_NEXT = 0x81,
//    DEVICE_AUTO_PREV = 0x82,
//    MAX_PLAY_DEVICE = 2,
//};


#define WRITE_RTC_SEC 			0x50
#define READ_RTC_SEC  			0x40
#define WRITE_RTC_ALM 			0x38
#define READ_RTC_ALM  			0x39

#define ALARM_TIME_UP			0x01
#define ALARM_STOP				0x02
#define RTC_DEVICE_IN			0x03

#define RING_ONCE				1
#define RING_EVERY_DAY			2
#define RING_WEEK				3

#endif